package cn.ac.iscas.service.junit;
import java.util.Calendar;

import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import cn.ac.iscas.bean.paper.ConferenceType;
import cn.ac.iscas.bean.paper.ConfererncePaper;
import cn.ac.iscas.bean.paper.State;
import cn.ac.iscas.service.paper.IPaperServive;

public class PaperJunitTest {
	private static IPaperServive service;
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		try {
			ApplicationContext act = new ClassPathXmlApplicationContext("application-context.xml");
			service= (IPaperServive)act.getBean("paperServiceImp");
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}	
	}
	@Test 
	public void save()
	{
		ConfererncePaper paper = new ConfererncePaper();
		paper.setEIInclude(true);
		paper.setEndPage(12);
		paper.setFirstAuthor("zhangxiaojie");
		paper.setFifthAuthor("zhang");
		paper.setFourthAuthor("xiaojie");
		paper.setKeyWord("hello world");
		paper.setNote("hello");
		paper.setPaperAbstract("中国会越来越强大的");
		paper.setPaperTittle("我爸是李刚");
	//	paper.setPDFpath("D:ddd");
		paper.setStartPage(10);
		paper.setReviewComments("很好很强大");
		paper.setSCiinlude(false);
		paper.setSecondAuthor("li");
		paper.setSixthAuthor("gangge");
		paper.setState(State.已录用);
		paper.setThirdAuthor("wang");
	//	paper.setWordPath("d:");
		paper.setConferenceAddress("山东省海阳市");
		Calendar c1 = Calendar.getInstance();
		c1.set(2010, Calendar.JANUARY, 12);
		paper.setConferenceEndTime(c1);
		paper.setConferenceName("sb会");
		//paper.setConferenceStartTime(c1);
	//	paper.setConferenceType(ConferenceType.INTERNATIONAL);
		service.save(paper);
	}

}
